package com.nuoniu.sibanyun.entity.so;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.nuoniu.sibanyun.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.junit.Ignore;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 销售发票主表
 * </p>
 *
 * @author 小啊刚
 * @since 2020-12-15
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("scs_invoice")
@ApiModel(value="VSaleInvoiceMain对象", description="销售发票主表")
public class
VSaleInvoiceMain extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "租户ID")
    @TableField("company_id")
    private Integer companyId;

    @ApiModelProperty(value = "账套ID")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "单据编码")
    @TableField("voucher_code")
    private String voucherCode;

    @ApiModelProperty(value = "单据日期")
    @TableField("voucher_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate voucherDate;

    @ApiModelProperty(value = "单据状态")
    @TableField("voucher_state")
    private Integer voucherState;

    @ApiModelProperty(value = "结算状态: 0:未结 1:已结")
    @TableField("settle_state")
    private Integer settleState;

    @ApiModelProperty(value = "客户ID")
    @TableField("crm_id")
    private Integer crmId;

    @ApiModelProperty(value = "客户名称")
    @TableField("crm_name")
    private String crmName;

    @ApiModelProperty(value = "客户简称")
    @TableField("crm_simple_name")
    private String crmSimpleName;

    @ApiModelProperty(value = "业务员ID")
    @TableField("salesman_id")
    private Integer salesmanId;

    @ApiModelProperty(value = "业务员名称")
    @TableField("salesman_name")
    private String salesmanName;

    @ApiModelProperty(value = "是否应收期初")
    @TableField("is_receivable_beginning")
    private Boolean isReceivableBeginning;

    @ApiModelProperty(value = "是否物料期初")
    @TableField("is_inventory_beginning")
    private Boolean isInventoryBeginning;

    @ApiModelProperty(value = "是否现付现结")
    @TableField("is_cash_payment")
    private Boolean isCashPayment;

    @ApiModelProperty(value = "是否退货")
    @TableField("is_return")
    private Boolean isReturn;

    @ApiModelProperty(value = "是否优先发货")
    @TableField("is_priority_delivery")
    private Boolean isPriorityDelivery;

    @ApiModelProperty(value = "银行编码")
    @TableField("bank_no")
    private String bankNo;

    @ApiModelProperty(value = "发票版本")
    @TableField("invoice_version")
    private String invoiceVersion;

//    @ApiModelProperty(value = "发票类型")
//    @TableField("invoice_type")
//    private String invoiceType;

    @ApiModelProperty(value = "发票类型ID")
    @TableField("invoice_type_id")
    private Integer invoiceTypeId;

    @ApiModelProperty(value = "发票类型名称")
    @TableField("invoice_type_name")
    private String invoiceTypeName;

    @ApiModelProperty(value = "发票类型CODE")
    @TableField("invoice_type_code")
    private String invoiceTypeCode;

    @ApiModelProperty(value = "发票号码")
    @TableField("invoice_no")
    private String invoiceNo;

    @ApiModelProperty(value = "销售类型ID")
    @TableField("sale_type_id")
    private Integer saleTypeId;

    @ApiModelProperty(value = "销售类型名称")
    @TableField("sale_type_name")
    private String saleTypeName;

    @ApiModelProperty(value = "销售类型编码")
    @TableField("sale_type_code")
    private String saleTypeCode;

    @ApiModelProperty(value = "收发类别ID")
    @TableField("rd_style_id")
    private Integer rdStyleId;

    @ApiModelProperty(value = "收发类别")
    @TableField("rd_style_name")
    private String rdStyleName;

    @ApiModelProperty(value = "收发类别编码")
    @TableField("rd_style_code")
    private String rdStyleCode;


    @ApiModelProperty(value = "付款条件ID")
    @TableField("payment_terms_id")
    private Integer paymentTermsId;

    @ApiModelProperty(value = "付款条件编码")
    @TableField("payment_terms_code")
    private String paymentTermsCode;

    @ApiModelProperty(value = "业务类型")
    @TableField("business_type")
    private Integer businessType;

    @ApiModelProperty(value = "汇率")
    @TableField("exchange_rate")
    private BigDecimal exchangeRate;

    @ApiModelProperty(value = "币种ID")
    @TableField("currency_id")
    private Integer currencyId;

    @ApiModelProperty(value = "币种名称")
    @TableField("currency_name")
    private String currencyName;

    @ApiModelProperty(value = "税率")
    @TableField("tax_rate")
    private BigDecimal taxRate;

    @ApiModelProperty(value = "价税合计")
    @TableField("price_tax_total")
    private BigDecimal priceTaxTotal;

    @ApiModelProperty(value = "核销金额")
    @TableField("verification_amount")
    private BigDecimal verificationAmount;

    @ApiModelProperty(value = "科目编码")
    @TableField("accounting_code")
    private String accountingCode;

    @ApiModelProperty(value = "开票系统")
    @TableField("sale_invoice_system")
    private String saleInvoiceSystem;

    @ApiModelProperty(value = "开票状态")
    @TableField("electronic_sale_invoice_status")
    private Integer electronicSaleInvoiceStatus;

    @ApiModelProperty(value = "备注")
    @TableField("remarks")
    private String remarks;

    @ApiModelProperty(value = "自定义字段数据")
    @TableField("define_fields")
    private String defineFields;

    @ApiModelProperty(value = "复核人ID")
    @TableField("check_user_id")
    private Integer checkUserId;

    @ApiModelProperty(value = "复核人姓名")
    @TableField("check_user_name")
    private String checkUserName;

    @ApiModelProperty(value = "复核日期")
    @TableField("check_date")
    private LocalDate checkDate;

    @ApiModelProperty(value = "信用审核人_ID")
    @TableField("reviewer_user_id")
    private Integer reviewerUserId;

    @ApiModelProperty(value = "信用审核人")
    @TableField("reviewer_user_name")
    private String reviewerUserName;

    @ApiModelProperty(value = "信用审核日期")
    @TableField("reviewer_date")
    private LocalDateTime reviewerDate;

    @ApiModelProperty(value = "作废人ID")
    @TableField("invalid_user_id")
    private Integer invalidUserId;

    @ApiModelProperty(value = "作废人姓名")
    @TableField("invalid_user_name")
    private String invalidUserName;

    @ApiModelProperty(value = "作废日期")
    @TableField("invalid_date")
    private LocalDate invalidDate;

    @ApiModelProperty(value = "记账人id")
    @TableField("bookkeeping_user_id")
    private Integer bookkeepingUserId;

    @ApiModelProperty(value = "记账人")
    @TableField("bookkeeping_user_name")
    private String bookkeepingUserName;

    @ApiModelProperty(value = "记账日期")
    @TableField("bookkeeping_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate bookkeepingDate;

    @ApiModelProperty(value = "部门ID")
    @TableField("office_id")
    private Integer officeId;

    @ApiModelProperty(value = "部门名称")
    @TableField("office_name")
    private String officeName;

    @ApiModelProperty(value = "部门编码")
    @TableField("office_code")
    private String officeCode;

    @ApiModelProperty(value = "创建人ID")
    @TableField("create_user_id")
    private Integer createUserId;

    @ApiModelProperty(value = "创建人姓名")
    @TableField("create_user_name")
    private String createUserName;

    @ApiModelProperty(value = "创建日期")
    @TableField("create_date")
    private LocalDateTime createDate;

    @ApiModelProperty(value = "修改人ID")
    @TableField("update_user_id")
    private Integer updateUserId;

    @ApiModelProperty(value = "修改人姓名")
    @TableField("update_user_name")
    private String updateUserName;

    @ApiModelProperty(value = "修改时间")
    @TableField("update_date")
    private LocalDateTime updateDate;

    @ApiModelProperty(value = "提交人ID")
    @TableField("submit_user_id")
    private Integer submitUserId;

    @ApiModelProperty(value = "提交人姓名")
    @TableField("submit_user_name")
    private String submitUserName;

    @ApiModelProperty(value = "提交时间")
    @TableField("submit_date")
    private LocalDateTime submitDate;

    @ApiModelProperty(value = "来源单id")
    @TableField("source_voucher_id")
    private Integer sourceVoucherId;

    @ApiModelProperty(value = "来源单号")
    @TableField("source_voucher_code")
    private String sourceVoucherCode;

    @ApiModelProperty(value = "来源日期")
    @TableField("source_voucher_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate sourceVoucherDate;

    @ApiModelProperty(value = "来源单据")
    @TableField("source_voucher_type")
    private String sourceVoucherType;


    @ApiModelProperty(value = "总数量")
    @TableField("total_quantity")
    private BigDecimal totalQuantity;

    @ApiModelProperty(value = "累计执行数量")
    @TableField(exist = false)
    private BigDecimal cumExecuteQuantity;

    @ApiModelProperty(value = "累计退货数量（普通退货）")
    @TableField("cum_ret_quantity")
    private BigDecimal cumRetQuantity;


    @ApiModelProperty(value = "明细")
    @TableField(exist = false)
    private List<VSaleInvoiceDetail> orderDetailList;

}
